package com.mxx.common.security;

import javax.crypto.Cipher;

/**
 * @author: mxx
 * @date: 2022/3/21
 * @time: 10:17
 * @Description: 描述信息
 */
public class PaddingBuild<T> {

    public CipherModel cipherModel;
    private T t;


    public PaddingBuild(T t, CipherModel cipherModel) {
        this.cipherModel = cipherModel;
        this.t = t;
    }

    public T padding() {
        cipherModel.refreshModel(Constant.CipherPadding.PKCS5);
        cipherModel.generate();
        return t;
    }

    public T padding(Constant.CipherPadding padding) {
        cipherModel.refreshModel(padding);
        cipherModel.generate();
        return t;
    }

    public T noPadding() {
        cipherModel.refreshModel(Constant.CipherPadding.NO_PADDING);
        cipherModel.generate();
        return t;
    }


}
